<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var obj = {
      _age:18
    }
    Object.defineProperties(obj,{
      name:{
        writable:true,
        value:'why'
      },
      age:{
        get:function(){
          return this._age
        }
      }
    })
    console.log(obj.age);
    Object.getOwnPropertyDescriptor(obj,'name')
    Object.getOwnPropertyDescriptors(obj)
    Object.seal(obj) //obj不能配置和删除，密封
    Object.freeze(obj) //obj不能修改，冻结
  </script>
</body>
</html>